##
##  $Header: /pub/cvsroot/mydns/doc/man/Makefile.am,v 1.10 2003/03/07 18:01:48 bboy Exp $
##

MAN_PAGES	=	mydns.8 mydns.conf.5 mydnscheck.8 mydnsimport.8 mydnsexport.8
SUBDIRS		=	en es
SEDFILE 		=	../../version.sed
RUN			=	$(SHELL) $(top_srcdir)/missing --run

## Make sure version.sed exists
vars:
	@if ! `test -f $(SEDFILE)`; then cd ../.. && $(MAKE) sedfile; fi

manpages:
	@for f in $(MAN_PAGES); do \
	  srcdir=en; \
	  if ! test -z "$$LANG"; then \
	    if test -f $$LANG/$$f.in; then \
	      srcdir=$$LANG; \
	    else \
	      lng=`echo $$LANG | $(RUN) sed -e 's/_..//'`; \
	      if test -f $$lng/$$f.in; then \
	        srcdir=$$lng; \
	      fi; \
	    fi; \
	  fi; \
	  $(RUN) sed -f $(SEDFILE) $$srcdir/$$f.in > $$f; \
	done && echo "*** Man source: $$srcdir"

man: vars manpages

all:

clean:
	rm -rf $(MAN_PAGES) *~ core*

install: all
	@for f in $(MAN_PAGES); do \
	  if test -f $$f; then \
		 instdir=$(DESTDIR)$(mandir)/man`echo $$f | sed -e 's/^.*\\.//'`; \
	    $(INSTALL) -d $$instdir; \
	    $(INSTALL_DATA) $$f $$instdir/$$f; \
	    echo "*** Installed: $$instdir/$$f"; \
	  fi; \
	done

release: all
	@for f in $(MAN_PAGES); do \
	  if test -f $$f; then \
	    cp -f $$f /www/htdocs/mydns/doc/man; \
	  fi; \
	done

## Recent versions of automake seem to need this... *shrug*
install-info-am:


## vi:set ts=3:
